#
#===============================================================================
#
#         FILE:  Loader.pm
#
#  DESCRIPTION:  
#
#        FILES:  ---
#         BUGS:  ---
#        NOTES:  ---
#       AUTHOR:  Beomsu Chang (bschang), <bschang@phya.yonsei.ac.kr>
#      COMPANY:  
#      VERSION:  1.0
#      CREATED:  
#     REVISION:  ---
#===============================================================================

use strict;
use warnings;

use WebTranslate::TranslateManager;
package WebTranslate::Loader; {

use Object::InsideOut q/WebTranslate::Base/;

my @Project		:Field	:All(Project);
my @Ver			:Field	:All(Ver);
my @DirHash		:Field	:All(DirHash)	:type(hash);
	
sub _init :Init {
	my ($self, $arg) = @_;
	$self->DirHash({});
	$self->DirHash->{'en'} = 'data/en';
	$self->DirHash->{'ko'} = 'data/ko';
}

sub get_transmanager{
	my ($self,$file) = @_;
	my $filehash={};
	my $dirhash = $self->DirHash;
	map{$filehash->{$_} = $dirhash->{$_}.$file}keys %$dirhash;
	my $transman = WebTranslate::TranslateManager->new(Name=>$file,FileHash=>$filehash);
	#my $transman = WebTranslate::TranslateManager->new(Name=>$file,FileHash=>$firehash);
}


sub makeNewTrans {
	my ($self,%attr) = @_;
	my $podx = WebTranslate::PodX->new(%attr);
	$podx->loadX("./data/org/en/perlsub.pod");
	$podx->mergeUnits();
	print $podx->Data();
	$podx->saveFile("test.podx");
}

sub makeNewOrignal {
	my ($self, %attr) = @_;
	my $podx = WebTranslate::PodX->new(%attr);
	$podx->src2x("perlsub.pod");
	$podx->saveFile("./data/org/en/perlsub.pod");
}
} # End of paragraph

1;

